package cn.donghuapian.config;

import org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration;
import org.camunda.bpm.engine.impl.history.HistoryLevel;
import org.springframework.context.annotation.Configuration;

/**
 * @description: 经测试：这个配置和在yml有相同的效果,即时没有该配置启动
                  项目也会自动建表，但是会报错，需要再启动一次
 * @author: hzw
 * @time: 2024/9/4 16:17
 */
@Configuration
public class CamundaConfig extends StandaloneProcessEngineConfiguration {

    public CamundaConfig() {
        super.databaseSchemaUpdate = "true";
        super.historyLevel = HistoryLevel.HISTORY_LEVEL_FULL;
        super.isMetricsEnabled = false;
    }

    @Override
    protected void initDataSource() {
        super.jdbcDriver = "com.mysql.cj.jdbc.Driver";
        super.jdbcUrl = "jdbc:mysql://101.35.23.183:3306/donghuapian";
        super.jdbcUsername = "root";
        super.jdbcPassword = "Francis163";
        super.databaseSchemaUpdate = "true";
        super.initDataSource();
    }
}
